<?php
require_once 'lib/BaseModel.php';

class Role extends Tamtay_Table_Abstract
{
	protected $_name = 'mytt_role';
	protected $_primary = 'rid';
	
	public function getUserRoles($uid)
	{
        $db = $this->getSlaveDB();
		$sql="SELECT r.rid, r.name FROM mytt_role r INNER JOIN mytt_role_user ur ON ur.rid = r.rid WHERE ur.uid = $uid";
		return $db->fetchAll($sql);				
	}
}

